import request from '@/utils/request'

export function getRoutes() {
  return request({
    url: '/vue-element-admin/routes',
    method: 'get'
  })
}

export function getProducts(data) {
  return request({
    url: '/api/ruo/product/page',
    method: 'post',
    data
  })
}

export function addProduct(data) {
  return request({
    url: '/api/ruo/product',
    method: 'post',
    data
  })
}

export function updateProduct(data) {
  return request({
    url: '/api/ruo/product',
    method: 'patch',
    data
  })
}

export function statusProduct(data) {
  return request({
    url: '/api/ruo/product/release',
    method: 'patch',
    data
  })
}

export function deleteProduct(id) {
  return request({
    url: `/api/ruo/product/${id}`,
    method: 'delete'
  })
}
